package cn.iocoder.yudao.module.bpm.api.amis;

import cn.hutool.core.io.IoUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.bpm.api.amis.dto.AmisListColumConfigDto;
import cn.iocoder.yudao.module.bpm.service.amis.AmisFormConfigAnalysis;
import cn.iocoder.yudao.module.bpm.service.amis.AmisFormDataAnalysis;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@RestController
@Validated
public class AmisFormDataApiService implements AmisFormDataApi {


    @Resource
    private AmisFormDataAnalysis amisFormDataAnalysis;


    @Override
    public CommonResult<byte[]> amisExportToExcel(
            String amisFormCode,
            String type ,
            List<Map> dataList
    ) {
        return success(amisFormDataAnalysis.amisExportToExcel(amisFormCode, type, dataList));

    }
}
